#%%
import matplotlib.pyplot as plt

#%%
bleu_path = r'result\bleu.txt'
test_loss_path = r'result\test_loss.txt'
train_loss_path = r'result\train_loss.txt'

with open(bleu_path, 'r') as f:
    bleu = eval(f.read())

with open(test_loss_path, 'r') as f:
    test_loss = eval(f.read())

with open(train_loss_path, 'r') as f:
    train_loss = eval(f.read())

#%%
len(bleu), len(test_loss), len(train_loss)

#%%
fig, axes = plt.subplots(2, 1, figsize=(10, 10))

axes[0].plot(bleu)
axes[0].set_title('BLEU')
axes[0].set_xlabel('epoch')

axes[1].plot(test_loss, label='test loss')
axes[1].plot(train_loss, label='train loss')
axes[1].set_title('Loss')
axes[1].set_xlabel('epoch')
axes[1].legend()

plt.show()
# %%
